From f563c3671276b45ccb0ae9fb571ad533a1daaf56 Mon Sep 17 00:00:00 2001 From: Alex Williamson Date: Mon, 2 Jul 2007 09:38:51 -0600 Subject: [PATCH] [IA64] Fix NVRAM data cannot be saved when guest execute "reboot" Also fix "xm reboot" instruction in Xend. Signed-off-by: Zhang Xin --- tools/ioemu/target-i386-dm/helper2.c | 1 + tools/ioemu/vl.h | 9 +++++++++ tools/python/xen/xend/XendDomainInfo.py | 1 + 3 files changed, 11 insertions(+) diff --git a/tools/ioemu/target-i386-dm/helper2.c b/tools/ioemu/target-i386-dm/helper2.c index 5f106b5a3a..971ff257db 100644 --- a/tools/ioemu/target-i386-dm/helper2.c +++ b/tools/ioemu/target-i386-dm/helper2.c @@ -140,6 +140,7 @@ void cpu_reset(CPUX86State *env) if (xcHandle < 0) fprintf(logfile, "Cannot acquire xenctrl handle\n"); else { + xc_domain_shutdown_hook(xcHandle, domid); sts = xc_domain_shutdown(xcHandle, domid, SHUTDOWN_reboot); if (sts != 0) fprintf(logfile, diff --git a/tools/ioemu/vl.h b/tools/ioemu/vl.h index 3e4e191e2e..313a23625d 100644 --- a/tools/ioemu/vl.h +++ b/tools/ioemu/vl.h @@ -1498,4 +1498,13 @@ void destroy_hvm_domain(void); /* VNC Authentication */ #define AUTHCHALLENGESIZE 16 +#ifdef __ia64__ +static inline void xc_domain_shutdown_hook(int xc_handle, uint32_t domid) +{ + xc_ia64_save_to_nvram(xc_handle, domid); +} +#else +#define xc_domain_shutdown_hook(xc_handle. domid) do {} while (0) +#endif + #endif /* VL_H */ diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 2f9eb592f5..6860faa9e5 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -459,6 +459,7 @@ class XendDomainInfo: hvm_pvdrv = xc.hvm_get_param(self.domid, HVM_PARAM_CALLBACK_IRQ) if not hvm_pvdrv: code = REVERSE_DOMAIN_SHUTDOWN_REASONS[reason] + xc.domain_destroy_hook(self.domid) log.info("HVM save:remote shutdown dom %d!", self.domid) xc.domain_shutdown(self.domid, code) -- 2.30.2